package com.aizuda.boot.modules.business.contract.entity;

import com.aizuda.boot.modules.common.constant.enums.*;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 审批节点审批人配置实体类
 *
 * @Author sangyirong
 * @Version 1.0
 * @Date 2025/5/20 13:36
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("workflow_node_assignee")
public class WorkflowNodeAssigneeEntity {

    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "配置ID")
    private Integer id;

    @Schema(description = "节点ID，关联 workflow_node 表")
    private Integer nodeId;

    @Schema(description = "审批人来源（指定人员、指定角色、上级、部门负责人、申请人、自选审批人、表单内人员、审批规则、机器人自动审批）")
    private AssigneeSourceEnum assigneeSource;

    @Schema(description = "审批人来源配置 (如用户/角色ID，表单字段名，规则ID，配置规则较多，建议用 json 格式存储规则)")
    private String assigneeSourceConfig;

    @Schema(description = "审批模式（串行审批、并行审批、竞争审批）")
    private ApprovalModeEnum approvalMode;

    @Schema(description = "审批人为空时的策略")
    private EmptyAssigneeEnum emptyAssigneeStrategy;

    @Schema(description = "审批人为空时的策略配置 (如指定用户ID)")
    private String emptyAssigneeConfig;

    @Schema(description = "申请人与审批人是同一人时的策略（由发起人对自己审批、自动跳过、转交给直属上级审批、转交给部门负责人审批）")
    private SelfApprovalEnum selfApprovalStrategy;

    @Schema(description = "审批人参与并确认过合同协商时的策略（需要审批、自动通过）")
    private NegotiationConfirmedEnum negotiationConfirmedStrategy;

    @Schema(description = "审批顺序 (用于串行审批)")
    private Integer orderNum;

    @Schema(description = "创建时间")
    private Date createdAt;

    @Schema(description = "更新时间")
    private Date updatedAt;

    @Schema(description = "删除标识（0：否[默认]，1：是）")
    @TableLogic
    private Boolean isDeleted;
} 